import axios from 'axios'
import Vue from 'vue'

const instance = axios.create({
  baseURL: '',
  headers: {}
})

instance.interceptors.request.use(config => {
  return config
})

instance.interceptors.response.use(config => {
  return config.data
})

const plugin = {
  install () {
    Vue.prototype.$http = instance
    Vue.prototype.$get = instance
    Vue.prototype.$post = instance
  }
}

export default plugin
